<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<html>
	<head>
		<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
		<title>发票申请-金融风险管理系统</title>
		<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/scriptvalidator.js" type="text/javascript"></script>
		<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
		<script language='javascript'>

		function billView(id) {
			var form1 = document.form1;
			form1.action = "<s:property value='contextPath'/>/mf/apply/billView.do?entity.id="+id;
			form1.submit();
		}
		  
		function exportmf(){
			var form1 = document.form1;
			form1.action = "<s:property value='contextPath'/>/mf/apply/exportBillShopx.do";
			form1.submit();
		}
		
		$(document).ready(function(){
			$(".tr_data").each(function(){
				var end=$(this).children('td').length-4;
				var index_count=$(this).children('td').length-3;
				var count=0;
				for(var i=5;i<=end;i++){
					count+=$(this).children('td').eq(i).text()*1;
				}
				$(this).children('td').eq(index_count).text(count);
			});
		});
		
		function jumpPage(page) {
			var form1 = document.form1;
			form1.action = "<s:property value='contextPath'/>/mf/apply/view.do?currentPage=" + page;
			form1.submit();
		}
		</script>
	</head>
	<body  leftmargin='8' topmargin='8'>
	<div class="navigation">
	    <span><a href="javascript:window.history.back();"><img src="${contextPath}/images/back_nav_btn.png" /></a>
	    <a href="javascript:window.history.back();">返回</a>
	    <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
	     <a href="javascript:window.history.forward();">前进</a>
	    <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
	     <a href="javascript:window.location.reload();">刷新</a>
 	    </span>管理费&gt;&gt;发票申请
    
  	</div>
		<div class="xt_main_right_center">
		<form id="form1" name="form1" action="update.do" method="post" onSubmit="return Validator.Validate(this,3)">
			<table width="100%" border="0" cellpadding="1" cellspacing="1">
			<tr>
				<td class="left-td-width-bg">
					批次号：
				</td>
				<td width="30%" class="bline" align="left">
					<input name="entity.applyNum" value="<s:property value='entity.applyNum'/>" dataType="Require" msg="批次号不能为空" />
				</td>
				<td class="left-td-width-bg">
					申请人：
				</td>
				<td width="45%" class="bline" align="left">
					<s:property value="entity.applyUser.realName"/>
				</td>
			</tr>
		</table>
	
		<!-- 列表开始 -->	
		<s:if test="detailData!=null">
			<br/>
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
			  <tr>
			    <td height="25" align="left"><font color="#0066CC"><strong>管理费清单：</strong></font></td>
			    <td height="25" align="right"></td>
			  </tr>
			</table> 
			<table id="tab_data" width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
			  <tr> 
			    <td width="4%" class="top-td-width-bg">序号</td>
			    <td width="10%" class="top-td-width-bg">店号</td>
			    <td width="12%" class="top-td-width-bg">店名</td>
			    <td width="10%" class="top-td-width-bg">驻店顾问</td>
			    <td width="10%" class="top-td-width-bg">区域经理</td>
			    <s:iterator value="financials">
			    	<td width="<s:property value='26/financials.size'/>%" class="top-td-width-bg"><s:property value="name"/></td>
			    </s:iterator>
			    <td width="8%" class="top-td-width-bg">总计</td>
			    <td width="8%" class="top-td-width-bg">单独开票(月份)</td>
			    <td width="8%" class="top-td-width-bg">单独开票(金融机构)</td>
			    <td width="8%" class="top-td-width-bg">操作</td>
			  </tr>
			 <s:iterator value="detailData" id="objs" status="stx" >
				<tr height="26" align="center" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
					<td  class="down-center-td-width-bg">
						<s:property value="#stx.index+1"/>
					</td> 
				 	<s:iterator value="#objs" id="obj" status="st">
				 		<s:if test="#st.index==3">
				 			<td class="down-center-td-width-bg"><s:property value="getShopUserNames(#objs[0])"/></td>
				 			<td class="down-center-td-width-bg"><s:property value="getAreaManagerNames(#objs[0])"/></td>	
				 		</s:if>
				 		<s:if test="#st.Last">
				 			<td class="down-center-td-width-bg">
				 				<s:if test="#obj">是</s:if>
				 				<s:else>否</s:else>
				 			</td>
				 		</s:if>
				 		<s:if test="#st.index==#objs.length-2">
				 			<td class="down-center-td-width-bg">
				 				<s:if test="#obj">是</s:if>
				 				<s:else>否</s:else>
				 			</td>
				 		</s:if>
				 		<s:elseif test="#st.index!=0&&!#st.Last">
				 			<td class="down-center-td-width-bg"><s:property value="#obj"/></td>
				 		</s:elseif>
				 	</s:iterator>
				 	<td  class="down-center-td-width-bg">
						<a href="javascript:billView(<s:property value="#objs[0]"/>)" ><img src="${contextPath}/images/chakan.gif" alt="详情" width="16" height="18" border="0" /></a>
					</td> 
				</tr>
			</s:iterator>
			<tr bgcolor="#F9FCEF"> 
			 <td height="36" colspan="<s:property value='financials.size+9'/>" align="center">
					<%@ include file="/WEB-INF/view/common/pagination.jsp"%>
			 </td>
			</tr>
			</table>
			
			<table width="100%" border="0" cellpadding="1" cellspacing="1">
			<tr style="padding-top: 20px">
				<td class="bline" colspan="4" align="center">
				<%-- <img src="${contextPath}/images/export.png" alt="导出"  /> --%>
				<a href="javascript:exportmf()"><input type="button" onclick="exportmf()" value="导出"/></a>
				&nbsp;<input type="button" onclick="javascript:window.history.back();" value="返回"/>
				</td>
			</tr>
			</table>
		
			<br/>
		</s:if>
		<input type="hidden" name="id" value="<s:property value='entity.id'/>" />
		<input type="hidden" id="shopId" name="shopId" />
		</form>
		</div>
	</body>
</html>